// ActionScript file
import model.Chapter;

import mx.events.MenuEvent;


private function rollOverHandler(event:MenuEvent):void{
	
}

private function itemClickHandler(event:MenuEvent):void{
	
	//Code to check whether current edit object is dirty or not
	//If so then prompt the user to save changes or continue without saving
	
	switch(event.label){
		case "New Project":
			main.selectedChild = projectWizard;
			projectWizard.projectAuthor.text = "";
			projectWizard.projectTitle.text = "";
		break;
		case "Open Project":
			main.selectedChild = openProjectDialog;
		break;
		case "Chapter":
			createChapter();
		break;
		case "Character":
			createCharacter();
		break;
		case "Save":
			save();
		break;
	}
}

private function changeHandler(event:MenuEvent):void{
	
}

public function enableSaveOption():void{
	mainMenuBar.dataProvider.source[0].menuitem[0].fileitem[5].@enabled = true;
}

public function disableSaveOption():void{
	mainMenuBar.dataProvider.source[0].menuitem[0].fileitem[5].@enabled = false;
}

public function enableNewMenuItems():void{
	mainMenuBar.dataProvider.source[0].menuitem[0].fileitem[4].@enabled = true;
}

